package day19;

import java.util.ArrayList;
import java.util.List;
//数据过滤
public class Stream01 {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=1;i<=10;i++) {
            list.add(i);
        }
        List<Integer> list2=new ArrayList<>();
        list2=list.stream().filter(num->num%2==0).toList();
        System.out.println(list2);
    }
}
